﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="WindowsFormsAdaptService.cs" company="">
//   
// </copyright>
// <summary>
//   The windows forms adapt service.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Libium.Adapters
{
    using System.Windows.Forms;

    using Libium.Views;

    /// <summary>
    /// The windows forms adapt service.
    /// </summary>
    public class WindowsFormsAdaptService : AdaptService
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="WindowsFormsAdaptService"/> class.
        /// </summary>
        public WindowsFormsAdaptService()
        {
            AddAdapterFactory<Label, ITextView>(obj => new LabelAdapter(obj));
            AddAdapterFactory<ToolStripLabel, ITextView>(obj => new ToolStripLabelAdapter(obj));
            AddAdapterFactory<Button, ICommandView>(obj => new ButtonAdapter(obj));
            AddAdapterFactory<ToolStripButton, ICommandView>(obj => new ToolStripButtonAdapter(obj));
            AddAdapterFactory<TextBox, ITextEditView>(obj => new TextBoxAdapter(obj));
            AddAdapterFactory<ComboBox, IChoiceView>(obj => new ComboBoxAdapter(obj));
            AddAdapterFactory<CheckBox, ICheckView>(obj => new CheckBoxAdapter(obj));
            AddAdapterFactory<ToolStripDropDownButton, ICommandMenuView>(obj => new ToolStripDropDownButtonAdapter(obj));
            AddAdapterFactory<TabControl, IItemsView>(obj => new TabControlAdapter(obj));
            AddAdapterFactory<TabPage, INamedItemView>(obj => new TabPageAdapter(obj));
            AddAdapterFactory<OpenFileDialog, IOpenFileView>(obj => new OpenFileDialogAdapter(obj));
            AddAdapterFactory<SaveFileDialog, ISaveFileView>(obj => new SaveFileDialogAdapter(obj));
        }

        #endregion
    }
}